package goover.unit04;

import java.io.File;
import java.util.stream.Stream;

public class FileDemo02 {
    public static void main(String[] args){
        File file = new File("D:\\JAVA\\source");
        if(file.isDirectory()){
            String[] fileName = file.list(((dir, name) -> name.endsWith(".txt")));
            Stream.of(fileName).forEach(s -> System.out.println(s));
        }
    }
}
